(* blink derivation with shift operation *)
MEM ledr = 1136, buttonr = 1140;
CONST ledm = 4; (* for nano 9k replace with 32 *)
VAR led;

PROCEDURE delay;
    VAR cnt;
BEGIN
    cnt := 0;
    WHILE cnt < 50000 DO
        cnt := cnt + 1
    END
END;

BEGIN
    led := ledm;
    WHILE 1 = 1 DO
        led := led >> 1;
        IF led = 0 THEN
            led := ledm
        END;
        ledr := led;
        
        CALL delay
    END
END.
